import { createApp } from 'vue'
// import './style.css'
import App from './App.vue'

const app = createApp(App)

import hoverHandler from './directives/hover'
app.directive("hover", hoverHandler)

import InfiniteScrollDirective from './directives/InfiniteScroll'
app.directive("infinite-scroll", InfiniteScrollDirective)

import clickOutsideDirective from './directives/ClickOutside'
app.directive("click-outside", clickOutsideDirective)

import throttleDirective from './directives/Throttle'
app.directive("throttle", throttleDirective)

import LazyDirective from './directives/Lazy'
app.directive("lazy", LazyDirective)

// 全局错误捕获处理程序
app.config.errorHandler = (err, vm, info) => {
    // 处理错误
    console.error('app 发生错误：', err);
    console.error('app 错误组件：', vm);
    console.error('app 错误信息：', info);

    // 可以在这里发送错误日志给服务器或者进行其他错误处理操作
};

app.mount('#app')
